import request from '@/config/axios'

// 旅馆住宿 VO
export interface HotelRecordVO {
  id: number // 主键ID
  personId: number // 重点人id
  hotelName: string // 酒店名称
  hotelAddress: string // 酒店地址
  checkInTime: Date // 入住时间
  checkOutTime: Date // 退房时间
  roomNo: string // 房间号
  checkInPersonName: string // 入住人名字
  checkInPersonPhone: string // 入住人联系电话
}

// 旅馆住宿 API
export const HotelRecordApi = {
  // 查询旅馆住宿分页
  getHotelRecordPage: async (params: any) => {
    return await request.get({ url: `/member/hotel-record/page`, params })
  },

  // 查询旅馆住宿详情
  getHotelRecord: async (id: number) => {
    return await request.get({ url: `/member/hotel-record/get?id=` + id })
  },

  // 新增旅馆住宿
  createHotelRecord: async (data: HotelRecordVO) => {
    return await request.post({ url: `/member/hotel-record/create`, data })
  },

  // 修改旅馆住宿
  updateHotelRecord: async (data: HotelRecordVO) => {
    return await request.put({ url: `/member/hotel-record/update`, data })
  },

  // 删除旅馆住宿
  deleteHotelRecord: async (id: number) => {
    return await request.delete({ url: `/member/hotel-record/delete?id=` + id })
  },

  // 导出旅馆住宿 Excel
  exportHotelRecord: async (params) => {
    return await request.download({ url: `/member/hotel-record/export-excel`, params })
  }
}